define(function(require, exports, module){
  var cookie = require('../src/private/utils/Cookie');

  test('获取无效键值对', function(){
    var key = 'DummyKey';
    ok(typeof cookie.get(key) === 'undefined', '返回undefined');
  });

  test('设置单个新键值对', function(){
    var key = 'NewKey', val = 'NewVal';
    cookie.set(key, val);
    equal(cookie.get(key), val);
  });

  test('删除键值对', function(){
    var key = 'NewKey';
    cookie.remove(key);
    ok(typeof cookie.get(key) === 'undefined', '返回undefined');
  });

  test('设置单个过期的键值对(expires数据类型为Date)', function(){
    var key = 'NewKey', val = 'NewVal';
    cookie.set(key, val, new Date());
    equal(typeof cookie.get(key) , 'undefined', '返回undefined');
  });

  test('设置单个过期的键值对(expires数据类型为Number)', function(){
    var key = 'NewKey', val = 'NewVal';
    cookie.set(key, val, 0);
    equal(typeof cookie.get(key) , 'undefined', '返回undefined');
  });

  test('设置多个新键值对', function(){
    var key1 = 'NewKey1', val1 = 'NewVal1';
    var key2 = 'NewKey2', val2 = 'NewVal2';
    var key3 = 'NewKey3', val3 = 'NewVal3', expires3 = 0;
    
    cookie.set([{
      key: key1,
      val: val1
    }, {
      key: key2,
      val: val2
    }, {
      key: key3,
      val: val3,
      expires: expires3
    }]);
    var v1 = cookie.get(key1);
    var v2 = cookie.get(key2);
    var v3 = cookie.get(key3);

    deepEqual({v1: v1, v2: v2, v3: v3}, {v1: val1, v2: val2, v3: undefined});
  });

  test('检查无效键是否存在', function(){
    ok(!cookie.exist('DummyKey'));
  });
  test('检查有效效键是否存在', function(){
    var key = 'Key', val = 'Val';
    cookie.set(key, val, 1);
    ok(cookie.exist('Key'));
  });
});
